// 组合继承
function Person(gender) {
  this.head = 1
  this.foot = 2
  this.favorColor = ['red', 'blue']
  this.gender = gender
}
Person.prototype.showColor = function () {
  return this.favorColor
}

function Student(name, no, gender) {
  Person.apply(this, [gender])
  this.name = name
  this.no = no
}
Student.prototype = new Person()
Student.prototype.constructor = Student

let stu = new Student('Tom', 1, '女')
stu.favorColor.push('green')
console.log(stu)
console.log(stu.showColor()) // [ 'red', 'blue', 'green' ]
